package com.sinat.flowable.controller;


import com.sinat.flowable.common.Result;
import com.sinat.flowable.entity.SysCodeInfo;
import com.sinat.flowable.service.SysCodeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;


/**
 * 代码信息Controller
 *
 * @author 庄金明
 */
@RestController
@RequestMapping("/sys/codeInfo")
public class SysCodeInfoController extends BaseController {
    @Autowired
    private SysCodeInfoService sysCodeInfoService;

    /**
     * 根据代码类型查询代码信息清单
     *
     * @param codeTypeIds
     * @return
     */
    @GetMapping(value = "/getSysCodeInfos")
    public Result getSysCodeInfos(String codeTypeIds) {
        Map<String, List<SysCodeInfo>> sysCodeInfosMap = sysCodeInfoService.getSysCodeInfosFromDb(codeTypeIds);

        return Result.ok(sysCodeInfosMap);
    }
}
